package com.xzy.rule;


import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyRule {

/*ribbon负载均衡配置  此类不能放在主启动类包下，否则会被所有ribbon客户端共用，达不到定制化*/
    @Bean
    public IRule rule(){

       return new RandomRule();
    }

}
